<?php /* Smarty version 2.6.26, created on 2013-02-12 15:59:38
         compiled from tpattern_export.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'tpattern_export.html', 98, false),array('function', 'html_radios', 'tpattern_export.html', 107, false),array('modifier', 'escape', 'tpattern_export.html', 115, false),)), $this); ?>
<?php echo '<?xml'; ?>
 version="1.0" encoding="utf-8"<?php echo '?>'; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
	<style type="text/css">
		input.btnleft{	text-align:	left;};
 	</style>
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>
		<script type="text/javascript" src="./assets/scripts/search.js"></script>
		<script type="text/javascript">
			$(function() {
				
				$('#btn-export').click(function(){	
					if (chkWeek()) {
						if(confirm('ダウンロードしますか？')){
							document.fm.csv.value="download";
							document.fm.submit();
						}
					}
				});
				$('#year4').change(function(){
					var year4 = this.value;
					var myDate = new Date();
					var nowtime =  myDate.getTime();
					$.get("mmap_week_ajax.php",{ y: year4,t : nowtime }, function(data){
						$("#matrix_cd").children().remove();
						$("#matrix_cd").append( data ); 
					});
				});	
				$('.sort').change(function(){
					if (this.value == 2) {
						$('#tr_op3')['hide']();
						$('#tr_op2')['show']();
					}else if (this.value == 3) {
						$('#tr_op2')['hide']();
						$('#tr_op3')['show']();
					}else {
						$('#tr_op2')['hide']();
						$('#tr_op3')['hide']();
					}
				});
			});
			function chkWeek() {
				var weekid = $("#matrix_cd").val() ;
				if (weekid.length == 0){
					alert("週を選択してください");
					return false;
				 }
				return true;
			}
			function setSS( valcd, valnm ) {
				if (gPara == "shop") {
					document.fm.shop_cd.value = valcd;
					document.fm.shop_name.value = valnm;			
				}
			
				$('#dialog').dialog("close");
			}
		</script>
		<link rel="stylesheet" type="text/css" href="./assets/styles/tablesorter.css" />
		<script type="text/javascript" src="./assets/scripts/tablesorter.js"></script>
	</head>
	<body id="">
<?php echo $this->_tpl_vars['menu']; ?>

<?php echo $this->_tpl_vars['logout']; ?>

		<div id="container"><div class="wrapper">
			<h2>パターン管理</h2>
			<ul class="submenu clearfix">
				<?php if (! ( $this->_tpl_vars['isG6_7'] )): ?><li><a href="tpattern_index.php">店別配布明細検索．更新</a></li>
				<li><a href="tpattern_copy.php">店別配布明細登録</a></li><?php endif; ?>
				<li>店別配布明細出力</li>
				<li><a href="tpattern_shop.php">店別パターン部数ＤＬ</a></li>
				<?php if (! ( $this->_tpl_vars['isG2_3'] )): ?> <li><a href="tpattern_delive.php">分納明細出力</a></li> <?php endif; ?>
			</ul>
			<h3>店別配布明細出力</h3>
			<form name="fm" id="fm" method="get" action="tpattern_export.php" >
<table class="formTable">
					<tbody>
					<tr><th>※年度.週</th><td>
<?php echo smarty_function_html_options(array('id' => 'year4','name' => 'year4','options' => $this->_tpl_vars['year4'],'selected' => $this->_tpl_vars['forms']['year4']), $this);?>
 年<?php echo $this->_tpl_vars['err']['year4']; ?>
&nbsp;&nbsp;&nbsp;
<?php echo smarty_function_html_options(array('id' => 'matrix_cd','name' => 'matrix_cd','options' => $this->_tpl_vars['week'],'selected' => $this->_tpl_vars['forms']['matrix_cd']), $this);?>

					</td></tr><tr>
							<th>ブロック</th>
							<td>
<?php echo smarty_function_html_options(array('id' => 'block_cd','name' => 'block_cd','options' => $this->_tpl_vars['block'],'selected' => $this->_tpl_vars['forms']['block_cd']), $this);?>

							</td>
						</tr><tr>
<th>AJA名</th>
<td><?php echo smarty_function_html_radios(array('name' => 'sort','class' => 'sort','options' => $this->_tpl_vars['sorts'],'selected' => $this->_tpl_vars['forms']['sort'],'separator' => '&nbsp;'), $this);?>
&nbsp;
<span id="tr_op2"  style="display:<?php if (( $this->_tpl_vars['forms']['sort'] == 2 )): ?>block<?php else: ?>none<?php endif; ?>;">
<?php echo smarty_function_html_options(array('id' => 'area_cd','name' => 'area_cd','options' => $this->_tpl_vars['areauser'],'selected' => $this->_tpl_vars['forms']['area_cd']), $this);?>
<?php echo $this->_tpl_vars['err']['area_cd']; ?>
</span> 
<span id="tr_op3"  style="display:<?php if (( $this->_tpl_vars['forms']['sort'] == 3 )): ?>block<?php else: ?>none<?php endif; ?>;">
<?php echo smarty_function_html_options(array('id' => 'zone_cd','name' => 'zone_cd','options' => $this->_tpl_vars['zoneuser'],'selected' => $this->_tpl_vars['forms']['zone_cd']), $this);?>
<?php echo $this->_tpl_vars['err']['zone_cd']; ?>
</span> 
 </td></tr><tr><th>店舗</th>
							<td>
								<input type="text" name="shop_name" value="<?php echo $this->_tpl_vars['forms']['shop_name']; ?>
" class="text" readonly/>
								<input type="hidden" name="shop_cd"  value="<?php echo ((is_array($_tmp=$this->_tpl_vars['forms']['shop_cd'])) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" />
								<button type="button" id="shop" class="btn_search" rel="shop"><span>参照</span></button>
								<button type="button" id="shop_c" class = "btn_clear" rel="shop"><span>クリア</span></button>
							</td>
						</tr></table>
				<p class="button" style="text-align:center">
					<button type="button" id="btn-export" class="submit"><span>CSV出力</span></button>
				</p>
				<input type="hidden" name="search" value="1" />
				<input type="hidden" name="csv" />
			</form>
<div id="dialog" >
		</div></div>
		<?php echo $this->_tpl_vars['footer']; ?>

	</body>
</html>